// TemplateUtilities.java
// Mac Radigan
// $Id: TemplateUtilities.groovy 38 2011-10-17 06:40:45Z mac.radigan $
package org.radigan.xsp

import groovy.text.GStringTemplateEngine

public class TemplateUtilities {
  private static TemplateUtilities instance = null
  public static TemplateUtilities getInstance() {
    if(!instance) {
      instance = new TemplateUtilities()
    }
    return instance
  }
  private TemplateUtilities() { }
  public static String xsp(String template, Map binding) {
    def gStringTemplateEngine = new GStringTemplateEngine()
    def gStringTemplate = gStringTemplateEngine.createTemplate(template).make(binding)
    return gStringTemplate.toString()
  }
}

// *EOF*
